-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Sync cloud integration on Authorization problems #4324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
eb468fa
to
fd28d05
Compare
fd28d05
to
500523d
Compare
500523d
to
3ce2c47
Compare
3ce2c47
to
c962bd0
Compare
this.syncCountDueToRequestException++; | ||
this._session = { | ||
...this._session, | ||
expiresAt: new Date(Date.now() - 1), | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a hypothetical scenario I want to check with you here.
Let's say I have a GitHub token which has the required scopes to get my current account but not the scopes to get PRs.
So, every time the Launchpad automatically fetches PRs (let's say, every 5 minutes), it first gets the current account, which succeeds (and also resets the sync count) and then it tries to get PRs and fails because of the scope issue, throws an AuthenticationError, and we force it to sync.
This would cause us to sync every time the Launchpad fetches PRs which would hit our backend pretty hard and probably is not the intention, but..is it possible? If we can confirm that I am worrying for nothing, I think we are ok to merge.
Description
Here we sync the cloud connected integration with GKDev when we face an authorization problem hoping that during the sync they respond us with the actual token.
If we see that we keep facing the same error we don't try to sync again. Instead we disconnect the integration soon letting user know that they need to take an action to reconnect.
Related to:
Follow-ups:
Checklist
Fixes $XXX -
orCloses #XXX -
prefix to auto-close the issue that your PR addresses